# Contributor: Danilo Godec <danilo.godec@agenda.si>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=joe
pkgver=4.6
pkgrel=5
pkgdesc="Full featured terminal-based screen editor"
url="https://joe-editor.sourceforge.net/"
arch="all"
license="GPL-2.0-or-later"
makedepends="ncurses-dev"
subpackages="$pkgname-doc"
source="https://downloads.sourceforge.net/project/joe-editor/JOE%20sources/joe-$pkgver/joe-$pkgver.tar.gz
	c99.patch
	protos.patch
	"

prepare() {
	default_prepare
	update_config_sub
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
	install -Dm644 COPYING "$pkgdir"/usr/share/licenses/$pkgname/COPYING
}

sha512sums="
3dd64a994fb3d352a12bf027ef16d57d14ac2577fd63fb6b6e25cae46052befaa7c15dc029bff2f8c3275df90f0343bd46313601055d97277ea4540e109fbe82  joe-4.6.tar.gz
201e74d0af44a5c4c9cfd665a2a79222246e535deab017f6bf4884215644e89921a08b051f7ba43cdf8cdbbbb15a17e729088ced4e4b6f57e84c4472b28691bd  c99.patch
9ccd53de36e813c79dbd1c76e43c7f9b756243455e0faf7eb98e8ebeada30256393475270a9858c6f319f28b4fe56f320e81c7898e41cf8b4ade1c22000e6884  protos.patch
"
